/**
 * @description 生产模式下配置
 * @author xfj
 */

const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CompressionPlugin = require("compression-webpack-plugin");

module.exports = {
    mode: "production",
    plugins: [
        new CleanWebpackPlugin(),
        new CopyWebpackPlugin({
            patterns: [{
                from: 'public/**',
                to: '[name][ext]',
                globOptions: {
                    ignore: '**/index.html'
                }
            }]
        }),
        new CompressionPlugin({
            test: /\.js(\?.*)?$/i,
            exclude: /\/excludes/,
        })
    ]
}